/*
*  Copyright 2020-2021 Li Fei
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.pengshun.modules.api.coal.service.dto;

import com.pengshun.modules.api.coal.domain.enums.CoalInfoEnum;
import com.pengshun.modules.api.coal.domain.enums.UnitEnum;
import lombok.Data;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @description /
* @author lifei
* @date 2020-11-11
**/
@Data
public class CoalInfoDto implements Serializable {

    /** id */
    private Long coalInfoId;

    /** 煤块产品Id */
    private Long coalId;

    /** 名称 */
    private String coalName;

    /** key唯一编码 */
    private String categoryKey;

    /** 值 */
    private String value;

    /** 创建者 */
    private String createBy;

    /** 更新者 */
    private String updateBy;

    /** 创建日期 */
    private Timestamp createTime;

    /** 更新时间 */
    private Timestamp updateTime;

    private String unit;

//    public String getUnit() {
//        String units="—";
//        if(this.categoryKey!=null && this.value != null){
//            if(this.categoryKey.equals(CoalInfoEnum.HIGH_ORDER.getKey())||this.categoryKey.equals(CoalInfoEnum.LOW_ORDER.getKey())){
//                units= UnitEnum.KILOGRAM.getKey();
//            }else {
//                units= UnitEnum.PERCENT.getKey();
//                if(this.categoryKey.equals(CoalInfoEnum.CRC.getKey())){
//                    units="";
//                }
//            }
//        }
//        return units;
//    }

    public CoalInfoDto() {
    }

    public CoalInfoDto(String coalName, String value, String unit) {
        this.coalName = coalName;
        this.value = value;
        this.unit = unit;
    }

    public String getValue() {
        return value==null?"":value;
    }
}